package com.tarzan.edu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tarzan.edu.dao.EduVideoMapper;
import com.tarzan.edu.entity.EduVideo;
import com.tarzan.edu.entity.response.EduVideoResp;
import com.tarzan.edu.service.IEduVideoService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * @author liujinshan
 * @title: EduVideoServiceImpl
 * @projectName com.tarzan.edu.service.impl
 * @description: TODO
 * @date 2021/5/25 16:55
 */
@Service
public class EduVideoServiceImpl extends ServiceImpl<EduVideoMapper, EduVideo> implements IEduVideoService {

    /**
     * @param eduVideo
     * @return void
     * @title insert
     * @description TODO 插入小节信息
     * @author liujinshan
     * @data 2021/6/18 16:03
     */
    @Override
    public void insert(EduVideo eduVideo) {
        baseMapper.insert(eduVideo);
    }

    /**
     * @param id
     * @return com.tarzan.edu.entity.response.VideoVo
     * @title findVideoInfoById
     * @description TODO 根据id查询小节信息
     * @author liujinshan
     * @data 2021/8/19 16:16
     */
    @Override
    public EduVideoResp findVideoInfoById(String id) {
        EduVideoResp videoVo = new EduVideoResp();
        EduVideo eduVideo = baseMapper.selectById(id);
        BeanUtils.copyProperties(eduVideo,videoVo);
        return videoVo;
    }
}
